package com.pcbly.web.bean.dyncolumn;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import com.pcbly.web.bean.AbstractBaseBean;

public class DynColumnBean extends AbstractBaseBean {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2462209283781136498L;
	
	private String columnName;
	private String tableName;
	private String tableCName;
	private String columnCName;
	private String isList;
	private String isQuery;
	private String listStyle;
	private String queryStyle;
	private String dataType;
	private int dataLenth;
	final static String[]dataTypes={"date","datetime","varchar","char","text","clob","blob"};
	

	public String getColumnName() {
		return columnName;
	}

	public void setColumnName(String columnName) {
		this.columnName = columnName;
	}

	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	public String getColumnCName() {
		return columnCName;
	}

	public void setColumnCName(String columnCName) {
		this.columnCName = columnCName;
	}

	public String getIsList() {
		return isList;
	}

	public void setIsList(String isList) {
		this.isList = isList;
	}

	public String getIsQuery() {
		return isQuery;
	}

	public void setIsQuery(String isQuery) {
		this.isQuery = isQuery;
	}

	public String getListStyle() {
		return listStyle;
	}

	public void setListStyle(String listStyle) {
		this.listStyle = listStyle;
	}

	public String getQueryStyle() {
		return queryStyle;
	}

	public void setQueryStyle(String queryStyle) {
		this.queryStyle = queryStyle;
	}

	public String getDataType() {
		if(dataType==null){
			dataType=dataTypes[2];
		}
		return dataType;
	}

	public void setDataType(String dataType) {
		this.dataType = dataType;
	}

	public int getDataLenth() {
		return dataLenth;
	}

	public void setDataLenth(int dataLenth) {
		this.dataLenth = dataLenth;
	}

	public String getTableCName() {
		return tableCName;
	}

	public void setTableCName(String tableCName) {
		this.tableCName = tableCName;
	}

	/**
	 * @see java.lang.Object#equals(Object)
	 */
	public boolean equals(Object object) {
		return EqualsBuilder.reflectionEquals(this, object);
	}

	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return HashCodeBuilder.reflectionHashCode(this);
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return ToStringBuilder.reflectionToString(this,
				ToStringStyle.MULTI_LINE_STYLE);
	}

}
